home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_09
/
9n09104a
< prev
next >
Wrap
Text File
|
1991-07-08
|
737b
|
21 lines
long *datapointer;
int ticks, stopcount;
...
datapointer=(long *) malloc(stopcount*sizeof(long));
ticks=0;
while (ticks <=stopcount)
{ /*ERROR: Put last data
item off the end of the
malloc'd array while
processing a predefined
amount of incoming data
from a comm channel. */
if(dataready)
{ /* wait for data-ready signal */
*(datapointer + ticks) = process_data();
ticks++;
}
}